from django.contrib import admin

from .models import GoodsCategory,GoodsCategoryBrand,Goods,IndexAd,GoodsImage,Banner,HotSearchWords

class GoodsCategoryAdmin(admin.ModelAdmin):
    # 需要显示的字段信息
    list_display = ('id', 'add_time', 'category_type', 'code')

    # 设置哪些字段可以点击进入编辑界面，默认是第一个字段
    list_display_links = ('id', 'category_type')

    # 设置过滤器
    list_filter = ("category_type","add_time")
    # 指定排序字段
    ordering = ("add_time",)
    # 指定搜索字段
    search_fields = ("add_time", "category_type")

admin.site.register(GoodsCategoryBrand)
admin.site.register(Goods)
admin.site.register(IndexAd)
admin.site.register(GoodsImage)
admin.site.register(Banner)
admin.site.register(HotSearchWords)
admin.site.register(GoodsCategory,GoodsCategoryAdmin)
